//
//  Obstacle.m
//  Tank For IPhone
//
//  Created by 奕 朱 on 11-3-4.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Obstacle.h"
#import "StaticElement.h"
#import "Constant.h"

@implementation Obstacle
@synthesize isPass;
@synthesize isBulletPass;
@synthesize color;

- (id) init:(int) _x y:(int) _y {
	
	if (self = [super init]) {
		self.x = _x;
		self.y = _y;
		self.width = SCREEN_CELL_LENGTH;
		self.height = SCREEN_CELL_LENGTH;
	}
	
	return self;
}

- (void) draw:(CGContextRef)context {

	CGContextSetStrokeColorWithColor(context, color.CGColor);
	CGContextSetFillColorWithColor(context, color.CGColor);
	
	CGContextAddRect(context, CGRectMake(x, y, width, height));
	
	CGContextDrawPath(context, kCGPathFillStroke);
	
}

- (void) dealloc {

	[color release];
	[super dealloc];

}

@end
